Skip to content

fix(desktop): persist browser sessions across restarts, prevent tab unmounts, and increase tunnel limit - #53453

Open
4Liberty wants to merge 1 commit into
anomalyco:v2from
4Liberty:fix/browser-session-persistence
Open

4Liberty wants to merge 1 commit into
anomalyco:v2from
4Liberty:fix/browser-session-persistence

Conversation

@4Liberty

@4Liberty 4Liberty commented Oct 5, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #50382

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Resolves three issues affecting OpenCode Desktop's embedded browser pane:

  1. Sessions/Cookies Wiped on Reload: The browser pane previously generated an ephemeral UUID partition (opencode-browser-${crypto.randomUUID()}), causing all cookies, logins, IndexedDB, and Local Storage to be discarded on app restart or pane re-attachment. Switched to partition: "persist:opencode-browser" so Electron persists session cookies and authentication state across restarts in the persistent partition directory.
  2. Background Tabs Destroyed & Reloaded: Main frame navigation in the host window previously triggered did-start-navigation -> close(entry) -> page.dispose(), causing the browser pane to be destroyed and fully reloaded upon refocus. We retain lifecycle cleanup on actual window destruction while preventing spurious unmounts on internal window routing.
  3. Tunnel Bottleneck on Rich Assets: The RPC network proxy enforced an aggressive hard limit of 64 concurrent sockets (sockets.size >= 64), causing asset-rich pages to stall or throw 502 connection limit errors. Raised the connection ceiling to 512.

How did you verify your code works?

  • Verified Electron session persistence: session cookies and Local Storage are successfully retained across app restarts in Partitions/opencode-browser.
  • Tested page stability across backgrounding and navigation.
  • Verified asset loading concurrency under heavy network requests.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@4Liberty 4Liberty changed the title fix(browser): persist session storage across restarts, prevent tab unmount on navigation, increase tunnel connection limit fix(desktop): persist browser sessions across restarts, prevent tab unmounts, and increase tunnel limit Oct 8, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant